// 获取资讯
export const reqNews = (params) =>
  request({ url: "/news", method: "get", params });

// 添加新的资讯或修改资讯
export const reqAddOrUpdateNews = (data) => {
  if (data._id) {
    return request({ url: "/news", method: "put", data });
  } else {
    return request({ url: "/news", method: "post", data });
  }
};

// 删除类型
export const reqDeleteNews = (data) =>
  request({ url: "/news", method: "delete", data });
